Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
previous | next
Summary
In this PR we setup code generation via solita and shank.
We added shank as a dependency to the Rust program and annotated the first instruction in
order to describe which accounts should be passed to it and which should be writable and/or
signer.
NOTE that for now we only annotated the first instruction, we will worry about the other two
later.
Inside the TypeScript SDK (
./ts
) we added the configuration files.solitarc
and.prettierrc
that solita will use to generate the SDK code and then format it.Additionally we added the script
api:gen
that we can run in order to generate the IDL andthen the code.
What you can do
Read through the changed files in this PR.
Checkout the PR via
git switch 03 -c pr/03
and try the following from the./ts
folder:Run
yarn api:gen
.Even though it isn't necessary, setting the
DEBUG
env var as follows results in nicer and more readable output:previous | next